<?php
$icon_dir = $this->Html->assetUrl('img/icons/');
echo '<p>' . $this->Html->link('Thêm tài khoản', array('controller' => 'accounts', 'action' => 'add'), array('class' => 'btn btn-success')) . '</p>';
?>
<div class="panel panel-primary">
	<div class="panel-heading"><b>Số dư tổng:</b>
		<?php
		$classes = array(
			"btn btn-primary",
			"btn btn-success",
			"btn btn-info",
			"btn btn-warning",
			"btn btn-danger",
		);
		foreach ($grand_totals as $grand_total) {
			$class = next($classes);
			if (false === $class) {
				reset($classes);
				$class = next($classes);
			}
			echo '<button class="lead ' . $class . '">' . "{$grand_total[0]['grand_total']} {$grand_total['Account']['money_unit']}</button>\n";
		}
		?>
	</div>
	<div class="panel-body">
		<?php echo $this->element('Accounts/index', array('accounts' => $accounts)); ?>
	</div>
</div>